package zhishu.iceyyy.com.kd_khd.er_fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import zhishu.iceyyy.com.kd_khd.R;


/**
 * 分类
 */
public class One_Fragment extends Fragment {
    View view;
    @BindView(R.id.order_recyclerview)
    RecyclerView order_RecyclerView;
    @BindView(R.id.activity_main)
    LinearLayout activityMain;


    private ArrayList<RecycleViewItemData> dataList;
    private Recycle_Mainadapter adapter;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        if (view == null) {
            view = View.inflate(getActivity(), R.layout.fragment_fl, null);

            ButterKnife.bind(this, view);
            dataList = new ArrayList<RecycleViewItemData>();
            dataList.add(new RecycleViewItemData(new EditItem("未成交1"), 0));
            dataList.add(new RecycleViewItemData(new EditItem("未成交2"), 1));
            dataList.add(new RecycleViewItemData(new EditItem("未成交"), 2));
//            dataList.add(new RecycleViewItemData(new EditItem("查看更多"), 3));
            order_RecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
            order_RecyclerView.setItemAnimator(new DefaultItemAnimator());
            adapter = new Recycle_Mainadapter(dataList, getActivity());
            order_RecyclerView.setAdapter(adapter);
        }
        ViewGroup parent = (ViewGroup) view.getParent();
        if (parent != null) {
            parent.removeView(view);
        }


        return view;
    }


}
